home *** CD-ROM | disk | FTP | other *** search
/ IRIX Installation Tools & Overlays 2002 November / SGI IRIX Installation Tools & Overlays 2002 November - Disc 4.iso / dist / motif21_dev.idb / usr / Motif-2.1 / include / Xm / ColorObjP.h.z / ColorObjP.h
C/C++ Source or Header  |  2002-10-15  |  4KB  |  161 lines

  1. /* $XConsortium: ColorObjP.h /main/10 1996/12/16 18:30:49 drk $ */
  2. /*
  3.  * COPYRIGHT NOTICE
  4.  * Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
  5.  * ALL RIGHTS RESERVED (MOTIF).  See the file named COPYRIGHT.MOTIF
  6.  * for the full copyright text.
  7.  * 
  8.  */
  9. /*
  10.  * HISTORY
  11.  */
  12. #ifndef _XmColorObjP_h
  13. #define _XmColorObjP_h
  14.  
  15. #include <Xm/VendorSP.h>
  16.  
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20.  
  21. /** misc structures, defines, and functions for using ColorObj **/
  22.  
  23. #define XmCO_MAX_NUM_COLORS     8
  24. #define XmCO_NUM_COLORS         XmCO_MAX_NUM_COLORS
  25. #define XmPIXEL_SET_PROP_VERSION '1'
  26.  
  27. /* Constants for color usage */
  28. enum { XmCO_BLACK_WHITE, XmCO_LOW_COLOR, XmCO_MEDIUM_COLOR, XmCO_HIGH_COLOR };
  29.  
  30. typedef struct {
  31.     Pixel fg;
  32.     Pixel bg;
  33.     Pixel ts;
  34.     Pixel bs;
  35.     Pixel sc;
  36. } XmPixelSet;
  37.  
  38. typedef XmPixelSet Colors[XmCO_NUM_COLORS];
  39.  
  40. typedef struct _XmColorObjPart {
  41.     XtArgsProc          RowColInitHook;
  42.     XmPixelSet           *myColors;     /* colors for my (application) screen */
  43.     int                 myScreen;
  44.     Display             *display;     /* display connection for "pseudo-app" */
  45.     Colors             *colors;      /* colors per screen for workspace mgr */
  46.     int                 numScreens;   /*               for workspace manager */
  47.     Atom               *atoms;       /* to identify colorsrv screen numbers */
  48.     Boolean             colorIsRunning;   /* used for any color problem      */
  49.     Boolean             done;
  50.     int                *colorUse;
  51.     int                 primary;
  52.     int                 secondary;
  53.     int                 text;          /* color set id for text widgets */
  54.     int                 active;
  55.     int                 inactive;
  56.     Boolean             useColorObj;  /* read only resource variable */
  57.     Boolean             useText;        /* use text color set id for text? */
  58.     Boolean             useTextForList; /* use text color set id for lists? */
  59.     
  60.     Boolean        useMask;
  61.     Boolean        useMultiColorIcons;
  62.     Boolean        useIconFileCache;
  63.  
  64. #ifdef _SGIMOTIF
  65.     XtPointer    _SG_vendorExtension;
  66. #endif
  67.  
  68. } XmColorObjPart;
  69.  
  70.  
  71. typedef struct _XmColorObjRec {
  72.     CorePart         core;
  73.     CompositePart     composite;
  74.     ShellPart         shell;
  75.     WMShellPart        wm;
  76.     XmColorObjPart    color_obj;
  77. } XmColorObjRec;
  78.  
  79. typedef struct _XmColorObjClassPart {
  80.     XtPointer        extension;
  81.  
  82. #ifdef _SGIMOTIF
  83.     XtPointer    _SG_vendorExtension;
  84. #endif
  85.  
  86. } XmColorObjClassPart;
  87.  
  88. /* 
  89.  * we make it a appShell subclass so it can have it's own instance
  90.  * hierarchy
  91.  */
  92. typedef struct _XmColorObjClassRec{
  93.     CoreClassPart              core_class;
  94.     CompositeClassPart         composite_class;
  95.     ShellClassPart          shell_class;
  96.     WMShellClassPart           wm_shell_class;
  97.     XmColorObjClassPart        color_obj_class;
  98. } XmColorObjClassRec;
  99.  
  100.  
  101. externalref XmColorObjClassRec xmColorObjClassRec;
  102.  
  103.  
  104. #ifndef XmIsColorObj
  105. #define XmIsColorObj(w) (XtIsSubclass(w, xmColorObjClass))
  106. #endif /* XmIsXmDisplay */
  107.  
  108. externalref WidgetClass  xmColorObjClass;
  109. typedef struct _XmColorObjClassRec *XmColorObjClass;
  110. typedef struct _XmColorObjRec      *XmColorObj;
  111.  
  112.  
  113. #define  XmCO_DitherTopShadow(display, screen, pixelSet) \
  114.                         ((pixelSet)->bs == BlackPixel((display), (screen)))
  115.  
  116. #define  XmCO_DitherBottomShadow(display, screen, pixelSet) \
  117.                         ((pixelSet)->ts == WhitePixel((display), (screen)))
  118.  
  119. #define  XmCO_DITHER     XmS50_foreground
  120. #define  XmCO_NO_DITHER  XmSunspecified_pixmap
  121.  
  122.  
  123. /********    Private Function Declarations    ********/
  124.  
  125. extern Boolean XmeGetIconControlInfo( 
  126.                         Screen *screen,
  127.                         Boolean *useMaskRtn,
  128.                         Boolean *useMultiColorIconsRtn,
  129.                         Boolean *useIconFileCacheRtn) ;
  130.  
  131. extern Boolean XmeUseColorObj( void ) ;
  132.  
  133.  
  134. extern Boolean XmeGetColorObjData(
  135.                    Screen * screen,
  136.                    int *colorUse,
  137.            XmPixelSet *pixelSet,
  138.            unsigned short num_pixelSet,
  139.            short *active_id,
  140.            short *inactive_id,
  141.            short *primary_id,
  142.            short *secondary_id,
  143.            short *text_id) ;
  144.  
  145. extern Boolean XmeGetDesktopColorCells (
  146.                          Screen * screen, 
  147.              Colormap colormap, 
  148.              XColor * colors,  
  149.              int n_colors,     
  150.              int * ncolors_returns) ;
  151.  
  152. /********    End Private Function Declarations    ********/
  153.  
  154.  
  155. #ifdef __cplusplus
  156. }  /* Close scope of 'extern "C"' declaration which encloses file. */
  157. #endif
  158.  
  159. #endif /* _XmColorObjP_h */
  160.  
  161.